<?xml version="1.0" encoding="UTF-8"?>
<%@ page contentType="text/xml;charset=utf-8"%>
<%@ page import="java.io.InputStream"%>
<%@ page import="java.io.OutputStream"%>
<%@ page import="com.tomato.dao.*"%>
<%@ page import="com.tomato.bean.*"%>
<%@ page import="com.tomato.servlet.*"%>
<%@ page import="java.util.*"%> 
<%@ page import = "javax.jdo.PersistenceManager" %>
<%@ page import = "javax.jdo.Query" %>
<%@ page import = "com.google.appengine.api.datastore.Blob"%>
<%@ page import = "org.apache.commons.lang.*"%>

<data> 
<%	
	request.setCharacterEncoding("utf-8");
	Long id = null;
	Photo photo = null;
	List<Photo> list = new ArrayList();
	String str = request.getParameter("key");
	String[] st = str.split("/");
	for(int i = 0; i < st.length; i++) {
		id = Long.parseLong(st[i]);
		photo = PhotoDao.getInstance().getById(id);
		list.add(photo);
	}	
	for(Photo photos : list) {
		byte[] b = photos.getEbook().getBytes();
		String text = StringEscapeUtils.escapeXml(new String(b,"utf-8"));
		
%> 
<lists>
	<id><%=photos.getId()%></id> 
	<genre><%=photos.getGenre()%></genre>
	<title><%=photos.getTitle()%></title>
	<author><%=photos.getAuthor()%></author>	
	<description><%=photos.getDescription()%></description>
	<ebook><%=text %></ebook>
	<count><%=photos.getCount()%></count>
	<date><%=photos.getDate()%></date>
</lists> 
<%
 	}
%> 
</data>
